from sqlalchemy.ext.asyncio import AsyncSession as Session
from app.models.api_log import ApiLog
from app.schemas.api_log import ApiLogCreate

async def create_api_log(session: Session, api_log: ApiLogCreate):
    db_api_log = ApiLog(**api_log.model_dump())
    session.add(db_api_log)
    await session.commit()
    await session.refresh(db_api_log)
    return db_api_log